﻿/*品牌与产品的hover*/
function Product_change(index, maid, mode) {
    var mode = document.getElementsByClassName(maid)[0].style.display = mode;
    /*var first_img = document.getElementById("img_1");*/
    var first_img =document.getElementsByClassName("img_1")[0];
    var title = document.getElementsByClassName("title")[0];
    var text = document.getElementsByClassName("text")[0];
    if (mode == 'block') {
        switch (index) {
            case 1:
                first_img.style.backgroundImage = "url(../imgs/甜点_1.png)";
                title.innerHTML = '美味甜甜圈';
                break;
            case 2:
                first_img.style.backgroundImage = "url(../imgs/甜点_2.png)";
                title.innerHTML = '芝士蛋糕';
                break;
            case 3:
                first_img.style.backgroundImage = "url(../imgs/甜点_3.png)";
                title.innerHTML = '闪电泡芙';
                break;
            case 4:
                first_img.style.backgroundImage = "url(../imgs/甜点_4.png)";
                title.innerHTML = '慕斯甜甜圈';
                break;
            case 5:
                first_img.style.backgroundImage = "url(../imgs/甜点_5.png)";
                title.innerHTML = '软欧圈';
                break;
            case 6:
                first_img.style.backgroundImage = "url(../imgs/甜点_6.png)";
                title.innerHTML = '麦芬圈';
                break;
            case 7:
                first_img.style.backgroundImage = "url(../imgs/甜点_1.png)";
                title.innerHTML = '起酥圈';
                break;
            case 8:
                first_img.style.backgroundImage = "url(../imgs/甜点_2.png)";
                title.innerHTML = '常规蛋糕';
                break;
            case 9:
                first_img.style.backgroundImage = "url(../imgs/甜点_3.png)";
                title.innerHTML = '果汁茶饮';
                break;
        }
      text.style.display='block';
        var img_2=document.getElementsByClassName("img_2")[0].style.display='none';
        var img_3=document.getElementsByClassName("img_3")[0].style.display='none';

    } else {
        first_img.style.backgroundImage = "";
        text.style.display='none';
        var img_2=document.getElementsByClassName("img_2")[0].style.display='block';
        var img_3=document.getElementsByClassName("img_3")[0].style.display='block';
    }

}
/*商品标题*/
function all_sort(mode, tmode) {
    var mode = document.getElementById("sort_title").style.display = mode;
    var tmode = document.getElementById("traingle").style.display = tmode;
    var li_one = document.getElementById("li_one");
    var li_two = document.getElementById("li_two");
    var traingle = document.getElementById("traingle");
    var sort_title = document.getElementById("sort_title");
    if (mode == 'block' || tmode == 'block') {
        sort_title.style.display = "block";
        traingle.style.display = "block";
        li_one.style.color = "#0d90fe";
        li_two.style.color = "#000000";
    } else {
        sort_title.style.display = "none";
        traingle.style.display = "none";
        li_one.style.color = "#000000";
        li_two.style.color = "#0d90fe";
    }
}
/*商品标题*/

/*品牌与产品的hover*/

function change_pro(index) {
    var little_text=document.getElementsByClassName('little_text')[0];
    var img_1=document.getElementsByClassName('img_1')[0];
    var img_2=document.getElementsByClassName('img_2')[0];
    var img_3=document.getElementsByClassName('img_3')[0];
    var img_4=document.getElementsByClassName('img_4')[0];
    var img_5=document.getElementsByClassName('img_5')[0];
    var img_6=document.getElementsByClassName('img_6')[0];
    var img_7=document.getElementsByClassName('img_7')[0];
    var img_8=document.getElementsByClassName('img_8')[0];
    var img_9=document.getElementsByClassName('img_9')[0];
    var little_title = document.getElementsByClassName("little_title")[0];
    if (index==1){
        img_2.style.display='none';
        little_text.style.display='block';
        little_text.style.left='10px';
        little_text.style.margin='-900px 0px 0px 300px';
    }
    if (index==2){
        img_3.style.display='none';
        little_text.style.display='block';
        little_text.style.left='10px';
        little_text.style.margin='-900px 0px 0px 625px';
        little_title.innerHTML = '芝士蛋糕';
    }
    if (index==3){
        img_2.style.display='none';
        little_text.style.display='block';
        little_text.style.margin='-900px 0px 0px 310px';
        little_title.innerHTML = '闪电泡芙';
    }
    if (index==4){
        img_5.style.display='none';
        little_text.style.display='block';
        little_text.style.left='10px';
        little_text.style.margin='-600px 0px 0px 300px';
        little_title.innerHTML = '慕斯甜甜圈';
    }
    if (index==5){
        img_6.style.display='none';
        little_text.style.display='block';
        little_text.style.left='10px';
        little_text.style.margin='-600px 0px 0px 625px';
        little_title.innerHTML = '软欧圈';
    }
    if (index==6){
        img_5.style.display='none';
        little_text.style.display='block';
        little_text.style.margin='-600px 0px 0px 310px';
        little_title.innerHTML = '麦芬圈';
    }
    if (index==7){
        img_8.style.display='none';
        little_text.style.display='block';
        little_text.style.left='10px';
        little_text.style.margin='-300px 0px 0px 300px';
        little_title.innerHTML = '起酥圈';
    }
    if (index==8){
        img_9.style.display='none';
        little_text.style.display='block';
        little_text.style.margin='-300px 0px 0px 625px';
        little_title.innerHTML = '常规蛋糕';
    }
    if (index==9){
        img_8.style.display='none';
        little_text.style.display='block';
        little_text.style.left='10px';
        little_text.style.margin='-300px 0px 0px 310px';
        little_title.innerHTML = '果汁茶饮';
    }
}

function unchange_pro(index) {
    var little_text=document.getElementsByClassName('little_text')[0];
    var img_1=document.getElementsByClassName('img_1')[0];
    var img_2=document.getElementsByClassName('img_2')[0];
    var img_3=document.getElementsByClassName('img_3')[0];
    var img_4=document.getElementsByClassName('img_4')[0];
    var img_5=document.getElementsByClassName('img_5')[0];
    var img_6=document.getElementsByClassName('img_6')[0];
    var img_7=document.getElementsByClassName('img_7')[0];
    var img_8=document.getElementsByClassName('img_8')[0];
    var img_9=document.getElementsByClassName('img_9')[0];
    if (index==1){
        img_2.style.display='block';
        little_text.style.display='none';
    }
    if (index==2){
        img_3.style.display='block';
        little_text.style.display='none';
    }
    if (index==3){
        img_2.style.display='block';
        little_text.style.display='none';
    }
    if (index==4){
        img_5.style.display='block';
        little_text.style.display='none';
    }
    if (index==5){
        img_6.style.display='block';
        little_text.style.display='none';
    }
    if (index==6){
        img_5.style.display='block';
        little_text.style.display='none';
    }
    if (index==7){
        img_8.style.display='block';
        little_text.style.display='none';
    }
    if (index==8){
        img_9.style.display='block';
        little_text.style.display='none';
    }
    if (index==9){
        img_8.style.display='block';
        little_text.style.display='none';
    }
}